//
//  UIView+ViewController.swift
//  Weibo
//
//  Created by 冯童童 on 16/1/20.
//  Copyright © 2016年 冯童童. All rights reserved.
//

import UIKit

extension UIView {
    
    func navController() -> UINavigationController? {
        
        var next = nextResponder()
        
        repeat {
            
        if let nextObj = next as? UINavigationController {
            return nextObj
            }
            next = next?.nextResponder()
        
        } while (next != nil)
        
        return nil
    }
}
